package cn.springcloud.alibaba.sys.controller.v1;

import cn.springcloud.alibaba.core.base.Result;
import cn.springcloud.alibaba.sys.dto.SysMenuDTO;
import cn.springcloud.alibaba.sys.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/v1/menu")
public class SysMenuController {

	@Autowired
	private SysMenuService sysMenuService;

	@GetMapping
	public Result<List<SysMenuDTO>> getSysMenus() {
		return sysMenuService.getSysMenus();
	}

	@PostMapping
	public Result<String> addSysMenu() {
		return sysMenuService.addSysMenu();
	}

	@PutMapping
	public Result<String> updateSysMenu() {
		return sysMenuService.updateSysMenu();
	}

	@DeleteMapping
	public Result<String> deleteSysMenu() {
		return sysMenuService.deleteSysMenu();
	}
}
